package ch01.Shangji;

import java.lang.reflect.Field;

public class Shangji2 {
    public static void main(String[] args) throws Exception{
        Class cla = Class.forName("ch01.entity.Person");
        Object person = cla.newInstance();

        Field name = cla.getDeclaredField("name");
        name.setAccessible(true);
        name.set(person,"牛逼");
        System.out.println("name="+name.get(person));
    }
}
